'''
Created on 2011-06-28

@author: Mikael
'''


class Entity(object):
    '''
    Represent an entity within the engine
    '''


    def __init__(self, guid=""):
        '''
        Constructor
        '''
        self.mComponentList = []
        self.mGUID = guid
        
    def AddComponent(self, component):
        self.mComponentList.append(component)
        
    def RemoveComponentByName(self, name=""):
        removeList = []
        
        #Build the remove list
        for comp in self.mComponentList:
            if comp.mName == name:
                removeList.append(comp)
        
        #Remove from the list
        for compToRemove in removeList:
            self.mPropertyList.remove(compToRemove)
